package com.chenhao.springcloud.chenhaodesignservice.pattern.creational.singleton;

/**
 * Description:懒汉模式
 *
 * @author chenhao
 * @date 2020/12/17 10:26
 */
public class LazySingleton {
    private static  LazySingleton lazySingleton =null;
    private LazySingleton(){

    }

    public synchronized static LazySingleton getLazySingleton() {
        if (lazySingleton==null){
            lazySingleton = new LazySingleton();
        }
        return lazySingleton;
    }
}
